import { ChangeDetectorRef, Component,Input, OnInit, ViewChild } from '@angular/core';
import { FormGroup, FormArray, FormControl, ControlContainer, FormGroupName } from '@angular/forms';
import * as dayjs from 'dayjs';

@Component({
  selector: 'm-step-4',
  templateUrl: './step-4.component.html',
  styleUrls: ['../add.component.scss'],
})
export class Step4Component implements OnInit {
  @Input() required = true;
  pcCount = 0 ;
  tips = ['可用于任务执行的时间范围，可参考组织日常工作时间设定，比如9:00-17:00；非工作时间任务将暂停下发任务将在执行周期内分批次匀速下发，非紧急任务建议至少设置8小时以上执行周期',
          '终端执行客户端更新的最大网速，可根据组织网络带宽情况进行设定'
          ]
	formGroup = new FormGroup({
		startTime: new FormControl("09:00"),
    endTime: new FormControl("18:00"),
    cycle:new FormControl(8),
    checkCycle:new FormControl(false),
    checkSpeed:new FormControl(false),
    speed:new FormControl(),
	});
  touched: () => void;

  blurHandel(key) {
    let value = this.formGroup.get(key).value?this.formGroup.get(key).value:0
    value = value>0?Number(value.toFixed(1)):0
    this.formGroup.get(key).setValue(value)
  }
    
	ngOnInit() {
	
	}
}
